//"The contents of this file are subject to the Mozilla Public License
//Version 1.1 (the "License"); you may not use this file except in
//compliance with the License. You may obtain a copy of the License at
//http://www.mozilla.org/MPL/

//Software distributed under the License is distributed on an "AS IS"
//basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
//License for the specific language governing rights and limitations
//under the License.

//The Original Code is TSharp.

//The Initial Developer of the Original Code is Mar3ek (http://mar3ek.wordpress.com).
//Portions created by Mar3ek are Copyright (C) 2010
//Mar3ek (http://mar3ek.wordpress.com). All Rights Reserved.

//Contributor(s): ______________________________________.

//Alternatively, the contents of this file may be used under the terms
//of the _____ license (the  "[___] License"), in which case the
//provisions of [______] License are applicable instead of those
//above.  If you wish to allow use of your version of this file only
//under the terms of the [____] License and not to allow others to use
//your version of this file under the MPL, indicate your decision by
//deleting  the provisions above and replace  them with the notice and
//other provisions required by the [___] License.  If you do not delete
//the provisions above, a recipient may use your version of this file
//under either the MPL or the [___] License."

using System;

namespace TSharp
{
    ///<summary>
    /// Class representing a direct message
    ///</summary>
    public class DirectMessage
    {
        private readonly DateTime _createdAt;
        private readonly ulong _id;
        private readonly TwitterUser _recipient;
        private readonly ulong _recipientId;
        private readonly string _recipientScreenName;
        private readonly TwitterUser _sender;
        private readonly ulong _senderId;
        private readonly string _senderScreenName;
        private readonly string _text;

        ///<summary>
        /// Creates a new instance of the class DirectMessage
        ///</summary>
        ///<param name="id">Message ID</param>
        ///<param name="senderId">ID of the sender</param>
        ///<param name="text">Text of the message</param>
        ///<param name="recipientId">ID of the recipient</param>
        ///<param name="createdAt">Time created</param>
        ///<param name="senderScreenName"></param>
        ///<param name="recipientScreenName">Screen name of the recipient</param>
        ///<param name="recipient">TwitterUser representing the recipient</param>
        ///<param name="sender">TwitterUser representing the sender</param>
        public DirectMessage(ulong id, ulong senderId, string text, ulong recipientId, DateTime createdAt,
                             string senderScreenName, string recipientScreenName, TwitterUser recipient,
                             TwitterUser sender)
        {
            _id = id;
            _senderId = senderId;
            _text = text;
            _recipientId = recipientId;
            _createdAt = createdAt;
            _senderScreenName = senderScreenName;
            _recipientScreenName = recipientScreenName;
            _sender = sender;
            _recipient = recipient;
        }

        ///<summary>
        /// Message ID
        ///</summary>
        public ulong Id
        {
            get { return _id; }
        }

        ///<summary>
        /// Sender ID
        ///</summary>
        public ulong SenderId
        {
            get { return _senderId; }
        }

        ///<summary>
        /// Text of the message
        ///</summary>
        public string Text
        {
            get { return _text; }
        }

        ///<summary>
        /// Recipient's user ID
        ///</summary>
        public ulong RecipientId
        {
            get { return _recipientId; }
        }

        ///<summary>
        /// Time created
        ///</summary>
        public DateTime CreatedAt
        {
            get { return _createdAt; }
        }

        ///<summary>
        /// Sender's screen name
        ///</summary>
        public string SenderScreenName
        {
            get { return _senderScreenName; }
        }

        ///<summary>
        /// Recipient's screen name
        ///</summary>
        public string RecipientScreenName
        {
            get { return _recipientScreenName; }
        }

        ///<summary>
        /// Recipient
        ///</summary>
        public TwitterUser Recipient
        {
            get { return _recipient; }
        }

        ///<summary>
        /// Sender
        ///</summary>
        public TwitterUser Sender
        {
            get { return _sender; }
        }
    }
}